<?php

namespace app\index\controller;

use think\Db;
use app\common\controller\Frontend;

class Crontab extends Frontend
{

    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = '';

    public function index(Int $day = 7)
    {
        return Db::name('fastim_message')->where('createtime', '<', strtotime("-{$day} day"))->delete();
    }

}
